<template>
    <div class="agent-item">
       <div class="agent-cell">
           <span class="agent-left bold-font">代理商名称</span>
           <span class="agent-right bold-font">{{agentInfo.company}}</span>
       </div>
       <!-- 法人信息 -->
       <div class="agent-panel">
            <div class="agent-cell" style="margin-top: 0rem;border-bottom:1px solid #ccc;">
                <span class="agent-left bold-font">法人信息</span>
            </div>
            <div class="agent-agent-cell">
                <span class="agent-agent-left">法人代表：</span>
                <span class="agent-agent-right">{{agentInfo.realName}}</span>
            </div>
            <div class="agent-agent-cell">
                <span class="agent-agent-left">法人电话：</span>
                <span class="agent-agent-right">{{agentInfo.tel}}</span>
            </div>
            <div class="agent-agent-cell">
                <span class="agent-agent-left">法人手机：</span>
                <span class="agent-agent-right">{{agentInfo.telephone}}</span>
            </div>
            <div class="agent-agent-cell">
                <span class="agent-agent-left">法人邮箱：</span>
                <span class="agent-agent-right">{{agentInfo.email}}</span>
            </div>
       </div>
        <!-- 购买折扣 -->
       <div class="agent-panel">
            <div class="agent-cell" style="border-bottom:1px solid #ccc;">
                <span class="agent-left bold-font">购买折扣</span>
            </div>
            <div class="agent-agent-cell">
                <span class="agent-agent-left">席位内购期折扣：</span>
                <span class="agent-agent-right">{{agentInfo.seatPurchaseDiscount}}%</span>
            </div>
            <div class="agent-agent-cell">
                <span class="agent-agent-left">席位内购发行期折扣：</span>
                <span class="agent-agent-right">{{agentInfo.seatDistribution}}%</span>
            </div>
            <div class="agent-agent-cell">
                <span class="agent-agent-left">席位申购期折扣：</span>
                <span class="agent-agent-right">{{agentInfo.seatApplyDiscount}}%</span>
            </div>
            <div class="agent-agent-cell">
                <span class="agent-agent-left">每日听书折扣：</span>
                <span class="agent-agent-right">{{agentInfo.bookDiscount}}%</span>
            </div>
             <div class="agent-agent-cell">
                <span class="agent-agent-left">微说折扣：</span>
                <span class="agent-agent-right">{{agentInfo.tmindDiscount}}%</span>
            </div>
       </div>
        <!-- 地址 -->
       <div class="agent-panel">
            <div class="agent-cell" style="border-bottom:1px solid #ccc;">
                <span class="agent-left bold-font">地址</span>
            </div>
            <div class="agent-agent-cell">
                <span class="agent-agent-left">{{agentInfo.address}}</span>
            </div>
       </div>
        <div class="agent-cell">
           <span class="agent-left bold-font">累计分润</span>
           <span class="agent-right bold-font">￥{{total}}</span>
       </div>
    </div>
</template>
<script>
import { post } from '../../../../util/http.js'
import { Toast } from 'mint-ui'
export default {
    data() {
        return {
            agentInfo: {},
            total: '',
            agentId: this.$route.params.id
        }
    },
     mounted () {
        let info = JSON.parse(window.localStorage.getItem('dongHang_data'))
        post('http://dlsapi.rz158.com/agent/myAgentDetail', {
            agentId: this.agentId
        }).then(res => {
            if(res.code == 0) {
                this.agentInfo = res.t
                this.total = res.v
                console.log(res)
            } else {
                Toast({
                    message: res.message,
                    duration: 1000
                })
            }
        })
    }
}
</script>

<style lang="less" scoped>
.bold-font{
    font-weight: bold;
}
.agent-item{
    background: #efefef;
    height: 100vh;
    .agent-cell{
        padding: 0rem .3rem;
        height: .84rem;
        background: #fff;
        .agent-left{
            float: left;
            font-size: .28rem;
            line-height: .84rem;
        }
        .agent-right{
            float: right;
            font-size: .28rem;
            line-height: .84rem;
        }
    }
    .agent-panel{
        margin: .2rem 0rem;
        .agent-agent-cell{
            padding: 0rem .3rem;
            height: .8rem;
            background: #fff;
             .agent-agent-left{
                float: left;
                font-size: .28rem;
                line-height: .8rem;
            }
            .agent-agent-right{
                float: right;
                font-size: .28rem;
                line-height: .8rem;
            }
        }
    
    }
}
</style>
